package durose.system.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import durose.system.mapper.EmplMapper;
import durose.system.pojo.Empl;
import durose.system.pojo.EmplExample;
import durose.system.service.EmplService;

@Service
public class EmplServiceImpl implements EmplService {
	@Autowired
	EmplMapper mapper;
	
	@Override
	public int emplAdd(Empl pojo) {
		return mapper.insert(pojo);
	}

	@Override
	public void emplDelete(int id) {
		mapper.deleteByPrimaryKey(id);
	}

	@Override
	public void emplUpdate(Empl pojo) {
		mapper.updateByPrimaryKey(pojo);
	}

	@Override
	public Empl emplGet(int id) {
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Empl> emplList(String queryName) {
		EmplExample example = new EmplExample();
		example.createCriteria().andEmpl_nameLike('%'+queryName+'%');
		return mapper.selectByExample(example);
	}
}
